<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/useradd.css" />
<script type="text/javascript" src="__PUBLIC__/js/jquery-1.8.2.min.js"></script>
<script type="text/javascript">
  $(function(){
	  $('.submit').click(
		function(){
			var obj=$(this).parents('tr').clone();
			obj.find('.submit').remove();
			$('#last').before(obj);
		}	  
	  );
  });
</script>
</head>
<body>
<form action="<?php echo U('Admin/Rbac/addUser','',false);?>" method="post">
	<table style="margin:0px auto;">
		<tr>
			<th colspan="2">添加用户</th>
		</tr>

		<tr>
			<td>用户名：</td>
			<td><input name="username" /></td>
		</tr>
		<tr>
			<td>密码：</td>
			<td><input name="password" /></td>
		</tr>
		<tr>
			<td>所属角色：</td>
			<td><select name="role_id[]">
					<option value="">--请选择--</option>
					<?php if(is_array($roles)): $i = 0; $__LIST__ = $roles;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><option value="<?php echo ($vo['id']); ?>"><?php echo ($vo["name"]); ?>(<?php echo ($vo["remark"]); ?>)</option><?php endforeach; endif; else: echo "" ;endif; ?>
			</select>
			<input type="button" value="添加一个角色" class="submit"/>
			</td>
		</tr>
		<tr id="last">
			<td colspan="2" align="center"><input type="submit" value="保存" class="submit"/></td>
		</tr>
	</table>
</form>
</body>
</html>